package com.jinzhi.jzweb.controller;


import java.util.*;

import com.jinzhi.jzweb.domain.param.SignUserResultQuery;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.annotation.Log;
import com.jinzhi.common.base.BaseController;
import com.jinzhi.jzweb.domain.JazSignupResultDO;
import com.jinzhi.jzweb.service.JazSignupResultService;
import com.jinzhi.common.utils.Result;

/**
 * 
 * <pre>
 * 成绩公示表
 * </pre>
 * <small> 2024-09-05 15:21:59 | Long</small>
 */
@Controller
@RequestMapping("/jzweb/jazSignupResult")
public class JazSignupResultController extends BaseController {
	@Autowired
	private JazSignupResultService jazSignupResultService;
	
	@GetMapping()
	//@RequiresPermissions("jzweb:jazSignupResult:jazSignupResult")
	String JazSignupResult(){
	    return "jzweb/jazSignupResult/jazSignupResult";
	}

	/**
	 * 分页查询
	 * @param signUserResultQuery
	 * @return
	 */
	@ResponseBody
	@GetMapping("/list")
	public Result<Page<JazSignupResultDO>> list(SignUserResultQuery signUserResultQuery){
        return Result.ok(jazSignupResultService.selectListPage(signUserResultQuery));
	}


	/**
	 * 新增成绩公示
	 * @param jazSignupResult
	 * @return
	 */
	@ResponseBody
	@PostMapping("/save")
	//@RequiresPermissions("jzweb:jazSignupResult:add")
	public Result<String> save(@RequestBody JazSignupResultDO jazSignupResult){
        return jazSignupResultService.insertSignupResult(jazSignupResult);
	}
	
	//@Log("修改成绩公示表")
	@ResponseBody
	@RequestMapping("/update")
	//@RequiresPermissions("jzweb:jazSignupResult:edit")
	public Result<String>  update( JazSignupResultDO jazSignupResult){
		boolean update = jazSignupResultService.updateById(jazSignupResult);
		return update ? Result.ok() : Result.fail();
	}

	/**
	 * 删除成绩公示
	 * @param id
	 * @return
	 */
	//@Log("删除成绩公示表")
	@PostMapping( "/remove")
	@ResponseBody
	//@RequiresPermissions("jzweb:jazSignupResult:remove")
	public Result<String>  remove( Long id){
		jazSignupResultService.deleteById(id);
        return Result.ok();
	}
	
	//@Log("批量删除成绩公示表")
	@PostMapping( "/batchRemove")
	@ResponseBody
	//@RequiresPermissions("jzweb:jazSignupResult:batchRemove")
	public Result<String>  remove(@RequestParam("ids[]") Long[] ids){
		jazSignupResultService.deleteBatchIds(Arrays.asList(ids));
		return Result.ok();
	}
	
}
